using System;
using DG.Tweening;
using UniFramework.Window;
using UnityEngine;

public class TestLauncher : MonoBehaviour
{
	private async void Start()
	{
		UniWindow.Initalize(this.gameObject);
		await UniWindow.OpenWindowAsync<TestWindow1>("TestWindow4");
		var testWindow1 = UniWindow.HasWindow<TestWindow1>();
	}
}

[Window(1, true)]
public class TestWindow1 : UIWindow
{
	public override void OnCreate()
	{
	}

	public override void OnRefresh()
	{
	}

	public override void OnUpdate()
	{
		if (Input.GetKeyDown(KeyCode.Space))
		{
			DoAnimation();
		}
	}

	public override void OnDestroy()
	{
	}

	private void DoAnimation()
	{
		var panel = transform.Find("Panel");
		panel.localScale = Vector3.zero;
		panel.DOScale(1f, 1f).SetEase(Ease.OutBack);
	}
}

[WindowAttribute(2, false)]
public class Test1Window2 : UIWindow
{
	public override void OnCreate()
	{
	}

	public override void OnRefresh()
	{
	}

	public override void OnUpdate()
	{
	}

	public override void OnDestroy()
	{
	}
}